﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ include file="/common/include/taglibs.jsp"%>
<%@ include file="/common/include/dictNames.jsp"%>
<%@ include file="/common/include/pageExpires.jsp"%>
  
<table width="90%" border="0" align="center">
  <tr>
    <td align="left" >学习管理→文章管理→添加文章</td>
  </tr>
</table>
<p><br />
</p>
<script>
	function checkSubmit(nextdo){
		if(document.fo1.language.value==document.fo1.targetlang.value){
		    alert("母语和学习语言不能相同")
		    return;
		}
		if(document.fo1.catarticleid.value==""){
		    alert("请选择文章类别")
		    return;
		}
	    document.fo1.nextdo.value=nextdo;
	    document.fo1.submit();
	}
</script>
<mytag:MyActionMsg />
<form name="fo1" action="/admin/study/manageArticle.do?CMD=add" method="post" enctype="multipart/form-data">
<input type="hidden" name="nextdo" value="add">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="100" align="right">母语： </td>
    <td align="left"><p>
      <mytag:national name="language" notEmpty="true"
		onchange="changeSelect(this.value)" value="<%=sessionLocale.toString()%>"
					dictName="<%=Constants.SYSLANGUAGE%>" />
    </p>    </td>
  </tr>
  <tr>
    <td align="right">学习语言：</td>
    <td align="left">
      <mytag:national name="targetlang" notEmpty="true"
					value="<%=sessionLocale.toString()%>"
					dictName="<%=Constants.SYSLANGUAGE%>" />
    </td>
  </tr>
  <tr>
    <td align="right">文章分类：</td>
    <td align="left">
      <select name="catarticleid">
		<option value="">-- 请选择 --</option>
	  </select>
<div style="position:absolute; visibility:hidden; ">
  <mytag:select name="catdatalist" notEmpty="true" language="all" dictName="<%=dict_cat_study3%>" />
  <script>
		function changeSelect(language){
			var dataList = document.fo1.catdatalist;
			var targetList = document.fo1.catarticleid;
			targetList.length = 1;
		    for(var i=0;i<dataList.length;i++){
		       if(dataList.options[i].language==language){
		           targetList.length = targetList.length+1;
		           targetList.options[targetList.length-1].value = dataList.options[i].value;
		           targetList.options[targetList.length-1].text  = dataList.options[i].text;	 
//alert("length="+targetList.length+"\n add "+dataList.options[i].text);          
		       }
		    }
		}
		changeSelect(document.fo1.language.value); //页面显示后直接初始化
   </script>  
</div>
    </td>
  </tr>
  <tr>
    <td align="right">文章标题：</td>
    <td align="left">
      <input type="text" name="title" />
    </td>
  </tr>
  <tr>
    <td align="right">文章内容：</td>
    <td align="left">
<%@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="FCK" %>
<script type="text/javascript" src="/FCKeditor/fckeditor.js"></script>
<FCK:editor id="content" basePath="/common/webeditor/"
		autoDetectLanguage="false"
		defaultLanguage="<%=JspHelper.getFCKLang("zh_CN") %>"
		imageUploadURL="/editor/filemanager/upload/simpleuploader?Type=Image"
		linkUploadURL="/editor/filemanager/upload/simpleuploader?Type=File"
		flashUploadURL="/editor/filemanager/upload/simpleuploader?Type=Flash">
</FCK:editor>
    </td>
  </tr>
  <tr>
    <td align="right">语音上传：</td>
    <td align="left">
        <input type="file" name="audio" />请添加swf、mp3、wma类型的语音文件
    </td>
  </tr>
  <tr>
    <td height="43" align="right">&nbsp;</td>
    <td>
      <input type="button" name="Submit" onclick="checkSubmit('add')" value="保存并继续添加" />
      <input type="button" name="Submit" onclick="checkSubmit('list')" value="保存并返回列表" />
    </td>
  </tr>
</table>
</form>